﻿$(function () {
    //采购详情
    procuredFan()
});
//采购详情
function procuredFan() {
   var procuredId =localStorage["procuredparticularsID"]
    $.ajax({
        url: "/RawMaterial/ProcuredMondel",
        type: "get",
        data: {
            Id: procuredId,
        },
        success: function (data) {
            data = JSON.parse(data);
            console.log(data.data);
            // 在 ajax 请求成功后，使用正确的表格 ID 进行 reload
            $(data.data).each(function () {
                $("#procuredId").text(this.procuredId)
                $("#ProcuredNumber").text(this.procuredNumber)
                $("#FeedstockNumber").text(this.feedstockNumber)
                $("#FeedstockName").text(this.feedstockName)
                $("#FeedstockNum").text(this.feedstockNum)
                $("#Feedstocktype").text(this.feedstocktype)
                $("#FeedstockSize").text(this.feedstockSize)
                var now = new Date(this.addTime);
                var year = now.getFullYear()
                var month = ("0" + now.getMonth() + 2).slice(-2);
                var day = ("0" + now.getDate()).slice(-2);
                $("#AddTime").text(year + "-" + month + "-" + day);
                $("#ProcuredBudget").text(this.procuredBudget)
                $("#PayMethods").text(this.payMethods)
                $("#LotNumber").text(this.lotNumber)
                $("#ProcessPrice").text(this.processPrice)
                $("#processActual").text(this.processActual)
                $("#procuredState").val(this.procuredState)
                if (this.procuredState == 0) {
                    $("#procuredState").text("待采购")
                } else {
                    $("#procuredState").text("已采购")
                }
            })
        }
        
    });
  
}
